<template>
  <div>
      <h1>评论{{id}}</h1>
      <div>
          <textarea v-model="content"></textarea>
          <input type="button" value="提交" @click="push">
      </div>
  </div>
</template>

<script>
export default {
    data(){
        return {
            id:this.$route.query.id,
            content:"",
        }
    },methods:{
        push(){
            this.axios.post("/comment",{"goods":this.id,"content":this.content}).then(resp=>{
            console.log(resp.data)
        }).catch(error=>{
            console.log(error)
        })
        }
    }
}
</script>

<style>

</style>